package com.dianhun.es.pc;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;
import java.net.URL;
/**
 * @author cyt
 * @create 2020-08-26 20:04
 */
public class Pc {
/*    public static void main(String[] args) throws IOException {
        String url = "https://search.jd.com/Search?keyword=java";
        Document parse = Jsoup.parse(new URL(url), 300000);
        Element j_goodsList = parse.getElementById("J_goodsList");
        Elements li = j_goodsList.getElementsByTag("li");
        for (Element element : li) {
            // source-data-lazy-img
            String img = element.getElementsByTag("img").eq(0).attr("src");
            String price = element.getElementsByClass("p-price").eq(0).text();
            String title = element.getElementsByClass("p-name").eq(0).text();
            System.out.println("============================");
            System.out.println(img + " - > " + price + " - > " + title);
        }
    }*/
}
